home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 11 / Mac Magazin and MacEasy Magazine CD - Issue 11.iso / Sharewarebibliothek / Entwickler / CDEF-DeBugger 2.0 ƒ / About Stub.c < prev    next >
Text File  |  1995-05-31  |  2KB  |  42 lines

  1. /************************************************************************************************
  2.  
  3.     The following is part of a conversion Marc White* and myself had after I gave him
  4.     version 1.0 of CDEF Debugger. Marc does a great job explaning the new method of
  5.     the CDEF stub we are using now in version 2.0.
  6.     
  7.     Marc:    That's a cool application. And thanks for the kind mention.
  8.     
  9.             I use a CDEF and LDEF stub method in my program here. I use my CDEF for a
  10.             pretty complicated C++ toolbar kinda thing, but the stub part is pretty
  11.             straightforward. The stub lets you debug it a source level, plus I use
  12.             Universal Procedure Pointers so that the CDEF will work in 68K and Native
  13.             modes. I'll append the code at the end of this message, you can use it in
  14.             updates to "CDEF - Debugger" if you want...
  15.  
  16.     Doug:    Um.. Marc... I not know what stub is...
  17.  
  18.     Marc:    Sorry to confuse you there. 
  19.     
  20.             Ok, here's a very simply explanation of a CDEF stub. You start by writing a
  21.             normal CDEF, but instead of handling all of the CDEF stuff in the code
  22.             resource, you just take the parameters that the Toolbox sends you and pass
  23.             them to the real CDEF which is in the application code. How do you find the
  24.             real CDEF? Because when you create the control in your code, you are tricky
  25.             and you store the address of the CDEF routine you want to use in the
  26.             control's refCon.
  27.         
  28.             This method is actually alot simpler than writing an assembly jump table
  29.             thingum. Plus, it is upwardly compatible with PowerPC code. The assembly
  30.             hack will break like the wind if it is executed while in native mode.
  31.         
  32.             The Universal Headers is just a folder of header files from Apple. They are
  33.             trying to standardize the headers for toolbox routines. You can determine
  34.             if you have them by looking in your Symantec folder for a folder called
  35.             "Universal Headers".
  36.  
  37.  
  38.     * Didn't I tell you Marc was a bright guy!
  39.  
  40. ************************************************************************************************/
  41.  
  42.